<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Date</title>
</head>
<body>
<script>
    var date = new Date();
    document.write(date+"<br>");
    //Fri Apr 16 2021 22:33:23 GMT+0800 (中国标准时间)
    document.write(date.toLocaleString()+"<br>");
    //2021/4/16下午10:35:49
    document.write(date.getTime()+"<br>");
</script>
</body>
</html>